<template>
    <div>
        <van-nav-bar :title="navBarTitle" left-text="返回" left-arrow @click-left="onClickLeft" />

        <van-area title="选择城市" :area-list="areaList" @confirm="onConfirm" />
    </div>
</template>

<script lang="ts" setup>
import { areaList } from '@vant/area-data';
// @ts-ignore
import { ref } from 'vue'
import { useRouter } from 'vue-router';
const router = useRouter();
const selectCity = ref([])
const onConfirm = (values: any[]) => {
    // @ts-ignore
    selectCity.value = values.selectedOptions;
    localStorage.setItem('city', selectCity.value[1].text)
    router.push('/home/home')
};
const onClickLeft = () => {
    router.push('/home/home')
}
</script>
<style lang="scss" scoped>
</style>